#include <memory>
#include "TcpServer.hpp"
#include "Command.hpp"

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cerr << "Usage: " << argv[0] << " localport" << std::endl;
    }
    uint16_t port = std::stoi(argv[1]);
    Command commandServer;
    std::unique_ptr<TcpServer> usvr = std::make_unique<TcpServer>(port, 
                    std::bind(&Command::HandlerCommand, &commandServer, std::placeholders::_1, std::placeholders::_2));
    usvr->Init();
    usvr->Start();
    return 0;
}